//
// Created by yunlang on 2021/12/1.
//
#include "File.h"
#include "HuffmanCompression.h"
#include "FileEncode.h"
#ifndef FILEARCHIVER_FILEIO_H
#define FILEARCHIVER_FILEIO_H
using namespace std;

class FileIO
{
private:
    static const unsigned int FMAX_BLOCK_BYTES;
    static const unsigned int EncodeFileInfoLength;
    static const unsigned int FileTypeInfoLength;
public:
    static File* readFromFile(const string& filename);
    static void writeToFile(const string& filename,
                     const unsigned char* fileInfo,
                     const unsigned char* decodeDataPtr,
                     const unsigned int decodeDataBits);
    static FileEncode* readFromZip(const string& filename);
    static void writeToZip(FILETYPE filetype, const string& filename,
                    const unordered_map<unsigned char, unsigned int>& weightMap,
                    const unsigned char* encodeData,
                    unsigned int encodeDataSize, unsigned int encodeDataBitSize);
    void getData();

};
#endif //FILEARCHIVER_FILEIO_H
//
// Created by yunlang on 2021/12/1.
//